<%@page contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@page import="java.util.*,com.ama.ticket.*"%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
 
<html>
    <head>
        <title>JPA Guest Book Web Application Tutorial</title>
    </head>
 
    <body>
        <form method="POST" action="UserServlet">
            Name: <input type="text" name="name" />
            <input type="submit" value="Add" />
        </form>
 
        <hr><ol> <%
            @SuppressWarnings("unchecked") 
            List<User> users = (List<User>)request.getAttribute("users");
            for (User user : users) { %>
                <li> <%= user %> </li> <a href="?op=del&id=<%=user.getId()%> ">delete</a><%
            } %>
        </ol><hr>
        
        <hr><ol> <%
            @SuppressWarnings("unchecked") 
            List<Ticket> tickets = (List<Ticket>)request.getAttribute("tickets");
            for (Ticket ticket : tickets) { %>
                <li> <%= ticket %> </li> <%
            } %>
        </ol><hr>
     </body>
 </html>